#include <bits/stdc++.h>

using namespace std;

FILE *fp = fopen("221900175output.out", "w+");

void print(const char *_format, ...) {
    va_list args;
    va_start(args, _format);
    vfprintf(fp, _format, args);
    va_end(args);
}

int main() {
    print("----------------Test1----------------\n");
    short test1 = -12345;
    print("origin short is  %12hd\tin 10base, %hx in 16base.\n", test1, test1);
    print("int          is  %12d\tin 10base, %x in 16base.\n", (int)test1, (int)test1);
    print("ushort       is  %12u\tin 10base, %x in 16base.\n", (unsigned short)test1, (unsigned short)test1);
    print("ushort       is  %12u\tin 10base, %x in 16base.\n", (unsigned int)test1, (unsigned int)test1);
    print("float        is  %6.4f\tin 10base, %a in 16base.\n", (float)test1, (float)test1);
    print("----------------Test2----------------\n");
    int test2 = 2147483646;
    print("origin int   is %12d\t\tin 10base, %x in 16base.\n", test2, test2);
    print("short        is %12hd\t\tin 10base, %hx in 16base.\n", (short)test2, (short)test2);
    print("ushort       is  %12u\t\tin 10base, %x in 16base.\n", (unsigned short)test2, (unsigned short)test2);
    print("ushort       is  %12u\t\tin 10base, %x in 16base.\n", (unsigned int)test2, (unsigned int)test2);
    print("float        is  %6.4f\tin 10base, %a in 16base.\n", (float)test2, (float)test2);
    print("----------------Test3----------------\n");
    float test3 = 123456.789e5f;
    print("origin float\tis\t %f in 10base, %a in 16base.\n", test3, test3);
    print("double\t\t\tis\t %lf in 10base, %a in 16base.\n", (double)test3, (double)test3);
    print("----------------Test4----------------\n");
    double test4 = 123456.789e5;
    print("origin double\tis\t %f in 10base, %a in 16base.\n", test4, test4);
    print("float\t\t\tis\t %lf in 10base, %a in 16base.\n", (float)test4, (float)test4);
    print("----------------Test5----------------\n");
    print("-12345 << 2 as short is\t\t %hd in 10base, %hx in 16base.\n",
        test1 << 2, test1 << 2);
    print("-12345 >> 2 as short is\t\t %hd in 10base, %hx in 16base.\n",
        test1 >> 2, test1 >> 2);
    print("-12345 << 2 as unsigned short is %hu in 10base, %x in 16base.\n",
        ((unsigned short)test1) << 2, ((unsigned short)test1) << 2);
    print("-12345 >> 2 as unsigned short is %hu in 10base, %x in 16base.\n",
        ((unsigned short)test1) >> 2, ((unsigned short)test1) >> 2);
    fclose(fp);
// ----------------Test1----------------
// origin short is        -12345	in 10base, cfc7 in 16base.
// int          is        -12345	in 10base, ffffcfc7 in 16base.
// ushort       is         53191	in 10base, cfc7 in 16base.
// ushort       is    4294954951	in 10base, ffffcfc7 in 16base.
// float        is  -12345.0000	    in 10base, -0xc.0e4p+10 in 16base.
// ----------------Test2----------------
// origin int   is   2147483646		in 10base, 7ffffffe in 16base.
// short        is           -2		in 10base, fffe in 16base.
// ushort       is         65534	in 10base, fffe in 16base.
// ushort       is    2147483646	in 10base, 7ffffffe in 16base.
// float        is  2147483648.0000	in 10base, 0x8p+28 in 16base.
// ----------------Test3----------------
// origin float	is	 12345678848.000000 in 10base, 0xb.7f707p+30 in 16base.
// double		is	 12345678848.000000 in 10base, 0xb.7f707p+30 in 16base.
// ----------------Test4----------------
// origin double	is	 12345678900.000000 in 10base, 0xb.7f7070dp+30 in 16base.
// float			is	 12345678848.000000 in 10base, 0xb.7f707p+30 in 16base.
// ----------------Test5----------------
// -12345 << 2 as short is		 16156 in 10base, 3f1c in 16base.
// -12345 >> 2 as short is		 -3087 in 10base, f3f1 in 16base.
// -12345 << 2 as unsigned short is 16156 in 10base, 33f1c in 16base.
// -12345 >> 2 as unsigned short is 13297 in 10base, 33f1 in 16base.
    return 0;
}
